package com.powerwyx.shortlink.project.config;

import com.powerwyx.shortlink.project.common.biz.user.UserTransmitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 王艺锡
 * @version 1.0
 */
@Configuration
public class UserConfiguration implements WebMvcConfigurer {

    @Autowired
    private UserTransmitInterceptor userTransmitInterceptor;

    /**
     * 用户信息传递过滤器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userTransmitInterceptor)
                .addPathPatterns("/**");
    }
}